#include<stdio.h>
#define MAX_NUMBER 100

int isDivisorAndUneven(int n, int result[MAX_NUMBER]);

int main()
{
	int n;
	scanf("%d", &n);
	int result[MAX_NUMBER] = {0};
	
	int i = 0, j = 0, num, sum = 0, sums = 0;
	for(i = 0; i < n; i ++)
	{
		scanf("%d", &num);
		int index;
		index = isDivisorAndUneven(num, result) - 1;
		
		if(index == 0)
		{
			sums = result[0];
		}
		else
		{
			sums = result[index - 1];
		}
		sum += sums;
		
		for(j = 0; j < MAX_NUMBER; j ++)
		{
			result[j] = 0;
		}
	}
	
	printf("%d\n", sum);
	
	return 0;
}

int isDivisorAndUneven(int n, int result[MAX_NUMBER])
{
	int k = 0, i;
	for(i = 1; i <= n; i ++)
	{
		if(n % i == 0)
		{
			if(i % 2 != 0)
			{
				result[k++] = i;
			}
		}
	}
	return k;
}
